Skip to content

Conversation

@Darren-Kelly-Unity
Copy link
Collaborator

@Darren-Kelly-Unity Darren-Kelly-Unity commented Sep 16, 2025

Description

You could cause multiple null or out of range exceptions if you press undo while editing a control scheme.
This is caused by undo causing the control scheme to be removed while you still have the edit window open.

Now the edit window will close immediately if you press undo while it's open.

Ticket:
https://jira.unity3d.com/browse/ISXB-1607

Video of fix (Usually undoing when editing the new control scheme would throw an exception / it could also cause other exceptions if the window was left open, therefore I now close it when this happens to avoid future issues):

Screen.Recording.2025-10-07.at.15.06.14.mov

Testing status & QA

Tested manually all the cases I could find until all exceptions were gone. There was multiple paths to create exceptions due to the asset being removed via undo.

Overall Product Risks

Please rate the potential complexity and halo effect from low to high for the reviewers. Note down potential risks to specific Editor branches if any.

  • Complexity: 2
  • Halo Effect: 1

Comments to reviewers

Please describe any additional information such as what to focus on, or historical info for the reviewers.

Checklist

Before review:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
    • Jira port for the next release set as "Resolved".
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

After merge:

  • Create forward/backward port if needed. If you are blocked from creating a forward port now please add a task to ISX-1444.

…ed by Undoing the creation of it via ctrl+z.
@codecov-github-com
Copy link

codecov-github-com bot commented Sep 16, 2025

Codecov Report

Attention: Patch coverage is 14.28571% with 18 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...or/UITKAssetEditor/Views/InputActionsEditorView.cs 20.00% 12 Missing ⚠️
.../UITKAssetEditor/Commands/ControlSchemeCommands.cs 0.00% 6 Missing ⚠️
@@             Coverage Diff             @@
##           develop    #2237      +/-   ##
===========================================
+ Coverage    76.70%   76.81%   +0.10%     
===========================================
  Files          465      476      +11     
  Lines        87919    88655     +736     
===========================================
+ Hits         67442    68097     +655     
- Misses       20477    20558      +81     
Flag Coverage Δ
inputsystem_MacOS_2021.3_project ?
inputsystem_MacOS_2022.3 5.39% <0.00%> (+0.02%) ⬆️
inputsystem_MacOS_2022.3_project 74.73% <0.00%> (+0.14%) ⬆️
inputsystem_MacOS_6000.0 5.18% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.0_project 76.59% <14.28%> (+0.08%) ⬆️
inputsystem_MacOS_6000.2 5.18% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.2_project 76.58% <14.28%> (+0.08%) ⬆️
inputsystem_MacOS_6000.3 5.18% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.3_project 76.58% <14.28%> (+0.08%) ⬆️
inputsystem_MacOS_6000.4 5.19% <0.00%> (+<0.01%) ⬆️
inputsystem_MacOS_6000.4_project 76.60% <14.28%> (+0.10%) ⬆️
inputsystem_MacOS_6000.5 5.19% <0.00%> (?)
inputsystem_MacOS_6000.5_project 76.60% <14.28%> (?)
inputsystem_Ubuntu_2021.3_project ?
inputsystem_Ubuntu_2022.3 5.40% <0.00%> (+0.02%) ⬆️
inputsystem_Ubuntu_2022.3_project 74.52% <0.00%> (+0.13%) ⬆️
inputsystem_Ubuntu_6000.0 5.19% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.0_project 76.39% <14.28%> (+0.07%) ⬆️
inputsystem_Ubuntu_6000.2 5.19% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.2_project 76.39% <14.28%> (+0.07%) ⬆️
inputsystem_Ubuntu_6000.3 5.19% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.3_project 76.39% <14.28%> (+0.07%) ⬆️
inputsystem_Ubuntu_6000.4 5.19% <0.00%> (+<0.01%) ⬆️
inputsystem_Ubuntu_6000.4_project 76.40% <14.28%> (+0.07%) ⬆️
inputsystem_Ubuntu_6000.5 5.19% <0.00%> (?)
inputsystem_Ubuntu_6000.5_project 76.41% <14.28%> (?)
inputsystem_Windows_2021.3_project ?
inputsystem_Windows_2022.3 5.39% <0.00%> (+0.02%) ⬆️
inputsystem_Windows_2022.3_project 74.85% <0.00%> (+0.13%) ⬆️
inputsystem_Windows_6000.0 5.18% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.0_project 76.71% <14.28%> (+0.06%) ⬆️
inputsystem_Windows_6000.2 5.18% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.2_project 76.71% <14.28%> (+0.07%) ⬆️
inputsystem_Windows_6000.3 5.18% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.3_project 76.71% <14.28%> (+0.06%) ⬆️
inputsystem_Windows_6000.4 5.19% <0.00%> (+<0.01%) ⬆️
inputsystem_Windows_6000.4_project 76.72% <14.28%> (+0.07%) ⬆️
inputsystem_Windows_6000.5 5.19% <0.00%> (?)
inputsystem_Windows_6000.5_project 76.72% <14.28%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...Editor/UITKAssetEditor/Views/ControlSchemesView.cs 0.00% <ø> (ø)
.../UITKAssetEditor/Commands/ControlSchemeCommands.cs 76.57% <0.00%> (-2.26%) ⬇️
...or/UITKAssetEditor/Views/InputActionsEditorView.cs 42.77% <20.00%> (-1.46%) ⬇️

... and 26 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Darren-Kelly-Unity Darren-Kelly-Unity changed the title FIX: out of range exception when pressing undo after creating and editing a new control scheme (ISXB-1607) (DRAFT) FIX: out of range exception when pressing undo after creating and editing a new control scheme (ISXB-1607) Sep 26, 2025
Copy link
Collaborator

@ekcoh ekcoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mainly asking question at this point since I am not sure I understand this fix or problem yet....

@Darren-Kelly-Unity Darren-Kelly-Unity marked this pull request as draft October 7, 2025 10:18
@Darren-Kelly-Unity Darren-Kelly-Unity marked this pull request as ready for review October 7, 2025 13:21
Copy link
Collaborator

@ekcoh ekcoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this Darren, not sure I fully understand the fix but it seems legit. Since the editor is something where we do not have the greatest coverage, do you think it would be feasible to auto-test this regression somehow? If not or unfeasible I think it can land as-is with manual testing.

@ekcoh
Copy link
Collaborator

ekcoh commented Oct 21, 2025

Merged develop into this branch to get critical CI fix from #2260. Hope this doesn't caused any inconvenience for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants